const Mock = require('mockjs')
// 内存模拟数据
const arr = []
for (let i = 0; i < 10; i++) {
  arr.push({
    id: Mock.mock('@guid'),
    name: Mock.mock('@cname'),
    place: Mock.mock('@county(true)'),
  })
}
module.exports = {
  'GET /list': (req, res) => {
    res.json(arr)
  },
  'DELETE /del': (req, res) => {
    console.log(req)
    const index = arr.findIndex((item) => item.id === req.query.id)
    arr.splice(index, 1)
    res.json({ success: true })
  },
}
